<template>
  <div>
    <p>{{word}}</p>
    <button @click="revFn">反转世界</button>
  </div>
</template>

<script>
export default {
  name: 'ReserveApp',

  data() {
    return {
      word:'Hello,World'
    };
  },

  methods: {
    revFn() {
      const str = this.word
      const StrToArr = str.split('') // 传入空字符串 相当于按位分割，['H','e','l'....]
      this.word = StrToArr.reverse().join('')
    }
  },
};
</script>

<style lang="less" scoped>

</style>
